
package robotinterface;

import java.awt.*;
import javax.swing.*;

/**
 *
 * @author Nate Hemmes
 */
public class SliderTab extends JComponent {

        static final int min = 0;
        static final int max = 100;
        static final int init = 50;

    public SliderTab(){

        SpringLayout sliderLayout = new SpringLayout();
        setLayout(sliderLayout);

        setBackground(Color.DARK_GRAY);

        JLabel sliderLabel = new JLabel("Sliders");

        add(sliderLabel);
        sliderLayout.putConstraint(SpringLayout.NORTH, sliderLabel, 10, SpringLayout.NORTH, this);
        sliderLayout.putConstraint(SpringLayout.WEST, sliderLabel, 270, SpringLayout.WEST, this);
        sliderLayout.putConstraint(SpringLayout.EAST, sliderLabel, -50, SpringLayout.EAST, this);

        BuildSlider joint1Panel = new BuildSlider("Joint 1:", 0, 100);
        add(joint1Panel);
        sliderLayout.putConstraint(SpringLayout.NORTH, joint1Panel, 19, SpringLayout.SOUTH, sliderLabel);
        sliderLayout.putConstraint(SpringLayout.WEST, joint1Panel, 10, SpringLayout.WEST, this);
        sliderLayout.putConstraint(SpringLayout.SOUTH, joint1Panel, 64, SpringLayout.SOUTH, sliderLabel);
        sliderLayout.putConstraint(SpringLayout.EAST, joint1Panel, -10, SpringLayout.EAST, this);

        BuildSlider joint2Panel = new BuildSlider("Joint 2:", 0, 100);
        add(joint2Panel);
        sliderLayout.putConstraint(SpringLayout.NORTH, joint2Panel, 16, SpringLayout.SOUTH, joint1Panel);
        sliderLayout.putConstraint(SpringLayout.WEST, joint2Panel, 10, SpringLayout.WEST, this);
        sliderLayout.putConstraint(SpringLayout.SOUTH, joint2Panel, 61, SpringLayout.SOUTH, joint1Panel);
        sliderLayout.putConstraint(SpringLayout.EAST, joint2Panel, -10, SpringLayout.EAST, this);

        BuildSlider joint3Panel = new BuildSlider("Joint 3:", 0, 100);
        add(joint3Panel);
        sliderLayout.putConstraint(SpringLayout.NORTH, joint3Panel, 16, SpringLayout.SOUTH, joint2Panel);
        sliderLayout.putConstraint(SpringLayout.WEST, joint3Panel, 10, SpringLayout.WEST, this);
        sliderLayout.putConstraint(SpringLayout.SOUTH, joint3Panel, 61, SpringLayout.SOUTH, joint2Panel);
        sliderLayout.putConstraint(SpringLayout.EAST, joint3Panel, -10, SpringLayout.EAST, this);

        BuildSlider joint4Panel = new BuildSlider("Joint 4:", 0, 100);
        add(joint4Panel);
        sliderLayout.putConstraint(SpringLayout.NORTH, joint4Panel, 16, SpringLayout.SOUTH, joint3Panel);
        sliderLayout.putConstraint(SpringLayout.WEST, joint4Panel, 10, SpringLayout.WEST, this);
        sliderLayout.putConstraint(SpringLayout.SOUTH, joint4Panel, 61, SpringLayout.SOUTH, joint3Panel);
        sliderLayout.putConstraint(SpringLayout.EAST, joint4Panel, -10, SpringLayout.EAST, this);

        BuildSlider joint5Panel = new BuildSlider("Joint 5:", 0, 100);
        add(joint5Panel);
        sliderLayout.putConstraint(SpringLayout.NORTH, joint5Panel, 16, SpringLayout.SOUTH, joint4Panel);
        sliderLayout.putConstraint(SpringLayout.WEST, joint5Panel, 10, SpringLayout.WEST, this);
        sliderLayout.putConstraint(SpringLayout.SOUTH, joint5Panel, 61, SpringLayout.SOUTH, joint4Panel);
        sliderLayout.putConstraint(SpringLayout.EAST, joint5Panel, -10, SpringLayout.EAST, this);

        BuildSlider joint6Panel = new BuildSlider("Joint 6:", 0, 100);
        add(joint6Panel);
        sliderLayout.putConstraint(SpringLayout.NORTH, joint6Panel, 16, SpringLayout.SOUTH, joint5Panel);
        sliderLayout.putConstraint(SpringLayout.WEST, joint6Panel, 10, SpringLayout.WEST, this);
        sliderLayout.putConstraint(SpringLayout.SOUTH, joint6Panel, 61, SpringLayout.SOUTH, joint5Panel);
        sliderLayout.putConstraint(SpringLayout.EAST, joint6Panel, -10, SpringLayout.EAST, this);

        BuildSlider joint7Panel = new BuildSlider("Joint 7:", 0, 100);
        add(joint7Panel);
        sliderLayout.putConstraint(SpringLayout.NORTH, joint7Panel, 16, SpringLayout.SOUTH, joint6Panel);
        sliderLayout.putConstraint(SpringLayout.WEST, joint7Panel, 10, SpringLayout.WEST, this);
        sliderLayout.putConstraint(SpringLayout.SOUTH, joint7Panel, 61, SpringLayout.SOUTH, joint6Panel);
        sliderLayout.putConstraint(SpringLayout.EAST, joint7Panel, -10, SpringLayout.EAST, this);

        BuildSlider gripperPanel = new BuildSlider("Gripper:", 0, 100);
        add(gripperPanel);
        sliderLayout.putConstraint(SpringLayout.NORTH, gripperPanel, 16, SpringLayout.SOUTH, joint7Panel);
        sliderLayout.putConstraint(SpringLayout.WEST, gripperPanel, 10, SpringLayout.WEST, this);
        sliderLayout.putConstraint(SpringLayout.SOUTH, gripperPanel, 61, SpringLayout.SOUTH, joint7Panel);
        sliderLayout.putConstraint(SpringLayout.EAST, gripperPanel, -10, SpringLayout.EAST, this);

    }
}
